home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / libraries / guienv374.lha / GUIEnvironment / M2Amiga / Modules / GUIEnvD.def next >
Encoding:
Modula Definition  |  1994-10-31  |  14.7 KB  |  433 lines

  1. (****************************************************************************
  2.  
  3. $RCSfile: GUIEnvD.def $
  4.  
  5. $Revision: 1.5 $
  6.     $Date: 1994/10/31 17:16:12 $
  7.  
  8.     All type and const definition for GUIEnvironment V37.4
  9.  
  10.     M2Amiga Modula-2 Compiler V4.3
  11.  
  12.   Copyright © 1994, Carsten Ziegeler
  13.                     Augustin-Wibbelt-Str.7, 33106 Paderborn, Germany
  14.  
  15.  
  16. ****************************************************************************)
  17. DEFINITION MODULE GUIEnvD; (*$ Implementation:=FALSE *)
  18.  
  19.   FROM SYSTEM     IMPORT ADDRESS;
  20.   FROM ExecD      IMPORT MsgPortPtr;
  21.   FROM GraphicsD  IMPORT TextAttrPtr;
  22.   FROM IntuitionD IMPORT IDCMPFlagSet, ScreenPtr, WindowPtr, GadgetPtr,
  23.                          DrawInfoPtr, IntuiMessagePtr, MenuItemPtr;
  24.   FROM LocaleD    IMPORT CatalogPtr, LocalePtr;
  25.   FROM UtilityD   IMPORT HookPtr, TagItemPtr, tagUser;
  26. IMPORT R;
  27.  
  28.  
  29. (* ======================================================================= *)
  30. (*                               Error codes                               *)
  31. (* ======================================================================= *)
  32.  
  33. CONST
  34.  
  35.   geDone             =   0;   (* no error, everything done *)
  36.   geMemoryErr        =   1;   (* not enough memory *)
  37.   geWindowErr        =   2;   (* no window specified *)
  38.   geVisualInfoErr    =   3;   (* couldn't get VisualInfo *)
  39.   geDrawInfoErr      =   4;   (* couldn't get DrawInfo *)
  40.  
  41.   geGadContextErr    = 100;   (* GadTools CreateContext failed *)
  42.   geGadCreateErr     = 101;   (* error calling CreateGadget/NewObject *)
  43.   geGadTooManyErr    = 102;   (* more than 256 gadgets *)
  44.   geGadKeyTwiceErr   = 102;   (* same key equivalent for two gadgets *)
  45.   geGadUnknownKind   = 104;   (* unknown gadget kind *)
  46.   geGadChainErr      = 105;   (* ChainStart/ChainEnd missing *)
  47.   geGadHookErr       = 106;   (* Hook function failed *)
  48.  
  49.   geMenuCreateErr    = 200;   (* error calling CreateMenu *)
  50.   geMenuStripErr     = 201;   (* error calling SetMenuStrip *)
  51.   geMenuLayoutErr    = 202;   (* error calling LayoutMenus *)
  52.   geMenuTooManyErr   = 203;   (* more than 256 menu items *)
  53.  
  54.  
  55. (* ======================================================================= *)
  56. (*                         GE Hook functions                               *)
  57. (* ======================================================================= *)
  58.  
  59. (* The GUIEnvironment hook functions:
  60.    - The hook functions are implemented as amiga callback hooks as
  61.      documented in the Utilities documentation
  62.    - Before a hook functions is called, the A4 register is set
  63.    - The A0 register points to Hook structure
  64.    - The A1/A2 register are used as stated below
  65.  
  66. *)
  67.  
  68. (* ------------------------ return values -------------------------------- *)
  69.  
  70.   gehKeyShifted  = 512;
  71.   gehKeyUnknown  = -1;
  72.  
  73. (* ------------------------ The hook functions --------------------------- *)
  74.  
  75. TYPE
  76.  
  77.          (* Hook function for key equivalents:
  78.  
  79.               A1      : Currently unused, set to NIL
  80.               A2      : LONGINT : The ASCII character code
  81.               RESULT  : LONGINT : gehKeyUnknown if the key is not a key
  82.                                   equivalent or the number of the gadget,
  83.                                   or the number of the gadget plus
  84.                                   gehKeyShifted !
  85.  
  86.  
  87.             Handle message hook
  88.  
  89.               A1, A2  : Currently unused, set to NIL
  90.               RESULT  : LONGINT, handled as BOOLEAN
  91.                         Return TRUE, if GUIEnv should not work on the
  92.                         message anymore, otherwise FALSE
  93.  
  94.  
  95.             Refresh hook
  96.  
  97.               A1, A2  : Currently unused, set to NIL
  98.               RESULT  : Currently unused, set this always to 0 !
  99.  
  100.  
  101.             Gadget event message hook
  102.  
  103.               A2      : Pointer to event gadget
  104.               A1      : Currently unused, set to NIL
  105.               RESULT  : LONGINT, handled as BOOLEAN
  106.                         If you want to wait for further messages return
  107.                         TRUE, otherwise FALSE to exit the message-loop.
  108.  
  109.  
  110.             Menu event message hook
  111.  
  112.               A2      : Pointer to event menu item (if possible)
  113.               A1      : Currently unused, set to NIL
  114.               RESULT  : LONGINT, handled as BOOLEAN
  115.                         If you want to wait for further messages return
  116.                         TRUE, otherwise FALSE to exit the message-loop.
  117.  
  118.  
  119.             Gadget creation hook
  120.  
  121.               A2      : Pointer to event gadget
  122.               A1      : Currently unused, set to NIL
  123.               RESULT  : LONGINT, handled as BOOLEAN
  124.                         If your creation hook has done his work, return
  125.                         TRUE, otherwise FALSE to stop creation !
  126.  
  127. *)
  128.  
  129. (* ======================================================================= *)
  130. (*                               Gadgets                                   *)
  131. (* ======================================================================= *)
  132.  
  133. CONST
  134. (* ----------------------- gadget kinds ---------------------------------- *)
  135.  
  136.   gegKinds                 =  65535; (* GUIEnv gadgets *)
  137.   gegProgressIndicatorKind =  65536;
  138.   gegBevelboxKind          =  65537;
  139.   gegBorderKind            =  65538;
  140.  
  141.   gegBOOPSIKinds           = 131071; (* BOOPSI gadgets *)
  142.   gegBOOPSIPublicKind      = 131072;
  143.   gegBOOPSIPrivateKind     = 131073;
  144.  
  145. (* ----------------------- gadget chain flags ---------------------------- *)
  146.  
  147. TYPE
  148.   GEGChainFlags = (gegChainUpNext, gegChainUpPrev, gegChainDownNext,
  149.                    gegChainDownPrev, gengcf4, gengcf5, gengcf6,
  150.                    gengcf7, gengcf8);
  151.  
  152.   GEGChainFlagSet = SET OF GEGChainFlags;  (* 16 bits *)
  153.  
  154. (* ----------------------- gadget description flags ---------------------- *)
  155.  
  156. CONST
  157.   gegDistNorm    =  0;  (* Normal distance *)
  158.   gegDistAbs     =  1;  (* absolute distance from an object *)
  159.   gegDistRel     =  2;  (* relative distance from an object *)
  160.   gegDistPercent =  3;  (* percentual distance *)
  161.  
  162.   gegObjBorder   =  0;  (* window border *)
  163.   gegObjGadget   =  4;  (* gadget (standard is previous gadget) *)
  164.  
  165.   gegObjRight    =  0;  (* distance from which part of the object *)
  166.   gegObjBottom   =  0;
  167.   gegObjLeft     = 32;
  168.   gegObjTop      = 32;
  169.  
  170. (* ----------------------- gadget tag values ----------------------------- *)
  171.  
  172.   gegACTIVATIONUP  =  0;
  173.   gegACTIVATIONDOWN=  1;
  174.  
  175.  
  176.   gegALLGADGETS    = -1;
  177.  
  178. (* ----------------------- gadget tags ----------------------------------- *)
  179.  
  180.   gegBase = tagUser + 016000H;
  181.   gegText            = gegBase +  1;
  182.   gegFlags           = gegBase +  2;
  183.   gegFont            = gegBase +  3;
  184.   gegUserData        = gegBase +  4;
  185.   gegDescription     = gegBase +  5;
  186.   gegObjects         = gegBase +  6;
  187.   gegGuideNode       = gegBase +  7;
  188.   gegCatalogString   = gegBase + 10;
  189.   gegClass           = gegBase + 11;
  190.   gegVarAddress      = gegBase + 12;
  191.   gegHandleInternal  = gegBase + 13;
  192.   gegStartChain      = gegBase + 14;
  193.   gegEndChain        = gegBase + 15;
  194.   gegActivate        = gegBase + 16;
  195.   gegChainActivation = gegBase + 17;
  196.   gegStatus          = gegBase + 19;
  197.   gegUpAHook         = gegBase + 20;
  198.   gegDownAHook       = gegBase + 21;
  199.   gegCreationAHook   = gegBase + 22;
  200.  
  201.   gegPIMaxValue      = gegBase + 50;
  202.   gegPICurrentValue  = gegBase + 51;
  203.   gegBBRecessed      = gegBase + 52;
  204.  
  205.   gegDisable         = gegBase + 100;
  206.   gegEnable          = gegBase + 101;
  207.   gegSetVar          = gegBase + 102;
  208.   gegGetVar          = gegBase + 103;
  209.   gegActivateUp      = gegBase + 104;
  210.   gegActivateDown    = gegBase + 105;
  211.  
  212.   gegAddress         = gegBase + 200;
  213.   gegLeftEdge        = gegBase + 201;
  214.   gegTopEdge         = gegBase + 202;
  215.   gegWidth           = gegBase + 203;
  216.   gegHeight          = gegBase + 204;
  217.   gegRedraw          = gegBase + 205;
  218.  
  219.  
  220. (* ----------------------- GUIGadgetInfo structure ------------------------ *)
  221.  
  222. TYPE
  223.  
  224.   GUIGadgetInfoPtr = POINTER TO GUIGadgetInfo; (* gadget^.userData *)
  225.  
  226.   GUIGadgetInfo = RECORD  (* a pointer to this structure is stored in
  227.                              gadget^.userData *)
  228.     userData : ADDRESS;   (* use this for own user data *)
  229.     kind     : LONGINT;   (* gadget kind *)
  230.  
  231.     gadgetClass : ADDRESS;(* The BOOPSI Gadget Class *)
  232.  
  233.     functionUp   : HookPtr;
  234.     functionDown : HookPtr;
  235.  
  236.     guideNode: ADDRESS;   (* The AmigaGuide node for this gadget *)
  237.  
  238.   END;
  239.  
  240. (* ======================================================================= *)
  241. (*                             Menu Items                                  *)
  242. (* ======================================================================= *)
  243.  
  244. CONST
  245. (* ---------------------- menu item tags --------------------------------- *)
  246.  
  247.   gemBase = tagUser + 018000H;
  248.   gemUserData        = gemBase + 1;
  249.   gemGuideNode       = gemBase + 3;
  250.   gemCatalogString   = gemBase + 4;
  251.   gemShortCut        = gemBase + 5;
  252.   gemFlags           = gemBase + 6;
  253.   gemMutualExclude   = gemBase + 7;
  254.   gemAHook           = gemBase + 8;
  255.  
  256. (* ---------------------- GUIMenuInfo structure -------------------------- *)
  257.  
  258. TYPE
  259.  
  260.   GUIMenuInfoPtr = POINTER TO GUIMenuInfo; (* menu^.userData *)
  261.  
  262.   GUIMenuInfo = RECORD    (* a pointer to this structure is stored in
  263.                               menuitem^.userData *)
  264.     userData : ADDRESS;   (* use this for own user data *)
  265.  
  266.     function : HookPtr;
  267.  
  268.     guideNode: ADDRESS;   (* The AmigaGuide node for this menuitem *)
  269.  
  270.   END;
  271.  
  272.  
  273.  
  274. (* ======================================================================= *)
  275. (*                            GUIInfo                                      *)
  276. (* ======================================================================= *)
  277.  
  278. (* -------------------------- GUIInfo structure -------------------------- *)
  279.  
  280.   GUIInfoPtr = POINTER TO GUIInfo;
  281.   GUIInfo = RECORD
  282.     window     : WindowPtr;         (* pointer to the used Window *)
  283.     screen     : ScreenPtr;         (* pointer to window's screen *)
  284.     visualInfo : ADDRESS;           (* pointer to screen's VisualInfo *)
  285.     drawInfo   : DrawInfoPtr;       (* pointer to a copy of DrawInfo *)
  286.     localeInfo : LocalePtr;         (* pointer to locale environment *)
  287.  
  288.     menuFont : TextAttrPtr;         (* pointer to menu-font. Is set to
  289.                                        screens font. *)
  290.  
  291.     creationWidth  : INTEGER;       (* window inner width *)
  292.     creationHeight : INTEGER;       (* window inner height *)
  293.  
  294.     msgPort  : MsgPortPtr;          (* Pointer to IDCMP-Port *)
  295.  
  296.     intuiMsg : IntuiMessagePtr;     (* Points to a copy of the
  297.                                        FULL IntuiMessage even if it
  298.                                        is extended (OS3.0+) *)
  299.  
  300.  (* Additional information about the message: *)
  301.     msgClass : IDCMPFlagSet;
  302.  
  303.     msgCode     : INTEGER;
  304.     msgBoolCode : BOOLEAN;
  305.     msgCharCode : CHAR;
  306.  
  307.     msgGadget  : GadgetPtr;
  308.  
  309.     msgItemAdr : MenuItemPtr;
  310.  
  311.     msgGadNbr  : INTEGER;
  312.  
  313.     msgMenuNum : INTEGER;
  314.     msgItemNum : INTEGER;
  315.     msgSubNum  : INTEGER;
  316.  
  317.  (* Some user stuff: *)
  318.     userData      : ADDRESS;        (* for own data *)
  319.     compilerReg   : ADDRESS;        (* for compiler data reg *)
  320.  
  321.     gadgetGuide   : ADDRESS;        (* name & path for the guide *)
  322.     menuGuide     : ADDRESS;        (* name & path for the guide *)
  323.  
  324.     catalogInfo   : CatalogPtr;     (* points to the catalog given
  325.                                        with the GUI_CatalogFile tag *)
  326.     gadgetCatalogString : LONGINT;  (* The number of the next string *)
  327.     menuCatalogString   : LONGINT;  (* in the catalog *)
  328.  
  329.     vanKeyHook    : HookPtr;        (* Hook functions *)
  330.     handleMsgHook : HookPtr;
  331.     refreshHook   : HookPtr;
  332.  
  333.     hookInterface : ADDRESS;
  334.  
  335.     creationFont  : TextAttrPtr;    (* GUIDefinition: text/gadget font *)
  336.     textFont      : TextAttrPtr;    (* Font for gadgets and text *)
  337.   END;
  338.  
  339. CONST
  340.  
  341. (* --------------------------- GUI Tags ------------------------------------ *)
  342.  
  343.   guiBase = tagUser + 015000H;
  344.   guiTextFont            = guiBase +  1;
  345.   guiMenuFont            = guiBase +  2;
  346.   guiCreateError         = guiBase +  4;
  347.   guiUserData            = guiBase +  5;
  348.   guiCompilerReg         = guiBase +  6;
  349.   guiGadgetGuide         = guiBase +  8;
  350.   guiMenuGuide           = guiBase +  9;
  351.   guiCatalogFile         = guiBase + 10;
  352.   guiGadgetCatalogOffset = guiBase + 11;
  353.   guiMenuCatalogOffset   = guiBase + 12;
  354.   guiCreationWidth       = guiBase + 13;
  355.   guiCreationHeight      = guiBase + 14;
  356.   guiMsgPort             = guiBase + 16;
  357.   guiRefreshAHook        = guiBase + 17;
  358.   guiHandleMsgAHook      = guiBase + 18;
  359.   guiVanKeyAHook         = guiBase + 19;
  360.   guiHookInterface       = guiBase + 20;
  361.   guiCreationFont        = guiBase + 21;
  362.   guiPreserveWindow      = guiBase + 22;
  363.  
  364.   guiRemoveMenu          = guiBase + 100;
  365.   guiRemoveGadgets       = guiBase + 101;
  366.   guiClearWindow         = guiBase + 102;
  367.   guiEmptyMsgPort        = guiBase + 103;
  368.   guiDoBeep              = guiBase + 104;
  369.   guiLock                = guiBase + 105;  (* Requires ReqTools *)
  370.   guiUnLock              = guiBase + 106;  (* Requires ReqTools *)
  371.  
  372.  
  373. (* -------------------- Preserve Window Flags ---------------------------- *)
  374.  
  375.   guiPWFull    = 0;   (* Preserve the window and the min and max values *)
  376.   guiPWSize    = 1;   (* Preserve only the window *)
  377.   guiPWMinMax  = 2;   (* Preserve only the min and max values *)
  378.  
  379.  
  380. (* ======================================================================= *)
  381. (*                             Requester                                   *)
  382. (* ======================================================================= *)
  383.  
  384. (* -------------------- Requester kinds ---------------------------------- *)
  385.  
  386.   gerGeneralKind = 0;
  387.   gerOKKind      = 1;
  388.   gerDoItKind    = 2;
  389.   gerYNCKind     = 3;
  390.   gerFileKind    = 4;
  391.   gerDirKind     = 5;
  392.  
  393.   gerRTKind      = 100;  (* Requires ReqTools *)
  394.   gerRTOKKind    = 101;
  395.   gerRTDoItKind  = 102;
  396.   gerRTYNCKind   = 103;
  397.   gerRTFileKind  = 104;
  398.   gerRTDirKind   = 105;
  399.  
  400. (* --------------------- Return values ----------------------------------- *)
  401.  
  402.   gerCancel = 0;  (* gerYNCKind / gerDoItKind / gerOKKind /
  403.                      gerFileKind / gerDirKind*)
  404.   gerYes    = 1;  (* gerYNCKind / gerDoItKind / gerFileKind / gerDirKind *)
  405.   gerNo     = 2;  (* gerYNCKind *)
  406.  
  407. (* --------------------- Requester tags ---------------------------------- *)
  408.  
  409.   gerBase = tagUser + 017000H;
  410.   gerGadgets        = gerBase +  1;
  411.   gerArgs           = gerBase +  2;
  412.   gerFlags          = gerBase +  3;
  413.   gerTitle          = gerBase +  4;
  414.   gerIDCMP          = gerBase +  5;
  415.   gerPattern        = gerBase +  6;
  416.   gerNameBuffer     = gerBase +  7;
  417.   gerFileBuffer     = gerBase +  8;
  418.   gerDirBuffer      = gerBase +  9;
  419.   gerSave           = gerBase + 10;
  420.   gerLocaleID       = gerBase + 11;
  421.  
  422.  
  423. (* ======================================================================= *)
  424. (*                              Windows                                    *)
  425. (* ======================================================================= *)
  426.  
  427. (* ---------------------- window tags ------------------------------------ *)
  428.  
  429.   gewBase = tagUser + 019000H;
  430.   gewOuterSize = gewBase + 1;
  431.  
  432. END GUIEnvD.
  433.